feat: add server/discover model types#943
Conversation
|
@howardjohn Could you please get CI to green? Thanks! |
7c0c7f2 to
0f7d76e
Compare
Add the SEP-2575 server/discover request and result model, wire it into the JSON-RPC request/result unions, and cover basic serde routing. Fixes modelcontextprotocol#869
0f7d76e to
33268aa
Compare
|
Shoudl be good now except the SemverCheck, apparently it needs a new major version to add a new enum 🤔 |
There was a problem hiding this comment.
Hey @howardjohn, sorry for getting to this late. We needed to wrap up the v2 work before jumping into implmenting the new spec. I left a couple of comments.
Shoudl be good now except the SemverCheck, apparently it needs a new major version to add a new enum 🤔
Can you rebase the branch? If it still fails the SemverCheck, make sure the commit message starts with feat!: and explain the breaking changes in the PR description.
| pub struct DiscoverResult { | ||
| pub supported_versions: Vec<ProtocolVersion>, | ||
| pub capabilities: ServerCapabilities, | ||
| pub server_info: Implementation, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub instructions: Option<String>, | ||
| #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] | ||
| pub meta: Option<Meta>, | ||
| } |
There was a problem hiding this comment.
The draft schema shows that this struct needs more fields.
https://modelcontextprotocol.io/specification/draft/schema#discoverresult
There was a problem hiding this comment.
Rebase onto main and use the ResultType introduced by #915.
rust-sdk/crates/rmcp/src/model.rs
Lines 693 to 695 in 60d3e77
| const_string!(DiscoverRequestMethod = "server/discover"); | ||
|
|
||
| /// Sent from the client to discover server identity, capabilities, and supported protocol versions. | ||
| pub type DiscoverRequest = Request<DiscoverRequestMethod, EmptyObject>; |
There was a problem hiding this comment.
EmptyObject would allow:
{
"method": "server/discover",
"params": {}
}Is this intended?
Motivation and Context
Add the SEP-2575 server/discover request and result model, wire it into the JSON-RPC request/result unions, and cover basic serde routing.
This only handles the basic model currently and does not wire up the server/client implementations, which will take some broader work around fallback to initialize etc.
For #869
How Has This Been Tested?
Tested in Agentgateway
Breaking Changes
None
Types of changes
Checklist
Additional context